package edu.bistu.sim.xwy.blog.Controller.Repository;
import edu.bistu.sim.xwy.blog.domain.BusGoodsInfo;
import edu.bistu.sim.xwy.blog.domain.NewsCom;
import edu.bistu.sim.xwy.blog.domain.NewsInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface BusGoodsResponsitory extends  JpaRepository<BusGoodsInfo,Integer> {
    @Query(value = "select  a from BusGoodsInfo a where a.busUser_goods_id.bus_user_id=:bus_user_id")
    List<BusGoodsInfo> AllGoodsById(@Param("bus_user_id")int bus_user_id);
    @Query(value ="select a from BusGoodsInfo a where a.busUser_goods_id.bus_user_name=:bus_user_name")
    List<BusGoodsInfo> findGoodsByName(@Param("bus_user_name") String bus_user_name);
}
